#ifndef editablemodel_H
#define editablemodel_H



#include <iostream>
#include <QtCore>
#include <QDebug>
#include <QCoreApplication>
#include <QObject>
#include "config.h"
#include "DB_Manager.h"



class EditableModel : public QTableView {
	
	Q_OBJECT
	
	
public:
	EditableModel( QWidget *parent = 0 );
	QMenu *CreateMenu();
	inline QSqlTableModel *amodel() { return model; }
	void  setDB( QSqlDatabase dbin );
	Qt::SortOrder  orderpaint;
	QHeaderView *horizontalheader;
	QAction *ActionUndoUpdate,
        *ActionCommit,
        *ActionReload,
				*ActionappendLine;
        QSqlTableModel *model; 
        QSqlDatabase db;
     void  contextMenuEvent ( QContextMenuEvent * e ) ;
      QShortcut *shortcut0;
    QShortcut *shortcut1;
signals:
public slots:
  void PaintTable( const QString table  );
  void Reload();
	void insert_line();
  void SaveData();
  void sortColumn( int cool );
};

#endif
